package com.cari.oa.domain;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 系统字典项实体类
 * User: yexuhui
 * Date: 12-12-12
 * Time: 下午10:06
 */
@Entity
@Table(name = "T_SYS_DICT_ITEM")
public class SysDictItemEntity implements Serializable {

    private static final long serialVersionUID = 8775225809962095596L;

    @Id
    @Length(max = 32)
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    private String id;

    @NotNull(message = "名称不能为空")
    @Length(max = 32, message = "名称长度要小于32个字符")
    private String name;

    @NotNull(message = "值不能为空")
    @Length(max = 100, message = "值长度要小于100个字符")
    private String value;

    @NotNull(message = "所属字典组不能为空")
    @Length(max = 32, message = "所属字典组名称长度不能超过32个字符")
    @Column(name = "group_name")
    private String groupName;

    @NotNull
    private Integer status = 0;	//状态（0：正常，1：注销）

    @Column(name = "create_time")
    private Date createTime = new Date();

    private String remark;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
